<?php

class UsuariosController extends AppController {

    public $helpers = array('Html', 'Form');
    public $name = 'Usuarios';

    public function index() {
        $this->set('usuarios', $this->Usuario->find('all'));
    }

    public function add() {
        if ($this->request->is('post')) {
            if ($this->Usuario->save($this->request->data)) {
                $this->redirect(array('action' => 'index'));
            }
        }
    }

    public function view($id = null) {
        $this->Usuario->id = $id;
        $this->set('post', $this->Usuario->read());
    }

}

?>
